SQLite Select 列名称包含字符串的数据,并仅使用 headers 创建一个 table

SQLite Select data where the column name contains a string and create a table with those headers only

根据对这个问题的回答:
SQLite Select 列名包含字符串的数据?

我想知道如何使用从以前的 table 获得的这些新列创建 table。 我写了这样的东西(请忽略 WHERE 语句):

CREATE TABLE new_table
AS(
SELECT name
FROM pragma_table_info("old_table")
WHERE name NOT LIKE '%\%%' ESCAPE '\'
FROM old_table
);  

但是,它不起作用。 在这方面的任何帮助将不胜感激。 非常感谢

如果你想要 old_table 的所有列,那么你可以这样做:

create table new_table as
select * from old_table
where 0;

如果您需要特定的列,您必须在 select 列表中指定它们:

create table new_table as
select col1, col2, ... from old_table
where 0;